package com.ruoyi.web.controller.mqtt;



import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.mqtt.MqttPushClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/*
*   mqtt的发送与接收
*
*
*/
@RestController
@RequestMapping("/mqtt")
public class MqttController  {

    @Autowired
    private MqttPushClient mqttPushClient;

    @GetMapping("/sendMsg")
    @ResponseBody
    public AjaxResult sendMsg() {

        return mqttPushClient.publish(0, false, "test01", "hello world  !!");

    }
}
